<template>
	<u-tabbar :value="act" :fixed="true" @change="changeTabBar" :placeholder="true" activeColor="#F7F9F9"
		inactiveColor="#0DA795" zIndex="999" :border="false" :safeAreaInsetBottom="true">
		<u-tabbar-item text="首页">
			<image class="u-page__item__slot-icon" slot="active-icon" src="@/static/assets/imgs/index-act.png"></image>
			<image class="u-page__item__slot-icon" slot="inactive-icon" src="@/static/assets/imgs/index.png"></image>
		</u-tabbar-item>
		<u-tabbar-item text="我的">
			<image class="u-page__item__slot-icon" slot="active-icon" src="@/static/assets/imgs/my-act.png"></image>
			<image class="u-page__item__slot-icon" slot="inactive-icon" src="@/static/assets/imgs/my.png"></image>
		</u-tabbar-item>
	</u-tabbar>
</template>

<script>
	export default {
		name: "my-tabbar",
		data() {
			return {

			};
		},
		props: {
			act: {
				type: String | Number,
				default: "index"
			},
		},
		methods: {
			changeTabBar(index) {
				switch (index) {
					case 0:
						uni.switchTab({
							url: "/pages/index/index"
						})
						break;
					case 1:
						uni.switchTab({
							url: "/pages/my/index"
						})
						break;
				}
			},
		}
	}
</script>

<style lang="scss">
	.u-page__item__slot-icon {
		width: 46rpx;
		height: 46rpx;
	}
	
</style>